
var app = getApp();
var ApiUrl = app.globalData.ApiUrl;
var mph = require("../../utils/util.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    hide_Popup_blen:false,
    user_info: {},
    resd: '',
  },
  show_Popup_box(){
    let that = this;
    that.data.hide_Popup_blen = true;
    that.setData({
      hide_Popup_blen: that.data.hide_Popup_blen
    })
  },
  hide_Popup_box() {
    let that = this;
    that.data.hide_Popup_blen = false;
    that.setData({
      hide_Popup_blen: that.data.hide_Popup_blen
    })
  },
  go_open_membership(){
    wx.navigateTo({
      url: '../../pages/open_membership/open_membership'
    })
  },
  go_respecting_members(){
    wx.navigateTo({
      url: '../../pages/respecting_members/respecting_members'
    })
  },
  go_forage_grass(){
    wx.navigateTo({
      url: '../../pages/forage_grass/forage_grass'
    })
  }, 
  my_info() {
    let that = this;
    //获得我的信息
    var url = 'index.php?act=member_index';
    mph.postRequest(url, {}, function (res) {
      console.log('我的商城:==>', res);
      if (res.data.code == 200) {
        let resd = (res.data.datas.member_info.level_info.exppoints_rate / res.data.datas.member_info.level_info.upgrade_exppoints * 100)+'%';
        that.setData({
          user_info: res.data.datas.member_info,
          resd: resd
        })
      } else {
        mph.showErrorTost(res.msg);
      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */

  onLoad: function (options) {
    this.my_info(); 
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})